package org.xukai.common.spel;

import java.util.HashMap;
import java.util.Map;

/**
 * 
 * @author JackyLIU
 *
 */
public abstract class AbstractKeyTranslater implements IKeyTranslater {

	/**
	 * 字段信息配置，key为键值
	 */
	protected Map<String, FieldConfig<?>> fieldConfigs;

	public Map<String, FieldConfig<?>> getFieldConfigs() {
		if(null == fieldConfigs)
			fieldConfigs = new HashMap<String, FieldConfig<?>>();
		return fieldConfigs;
	}
	
	public void setFieldConfigs(Map<String, FieldConfig<?>> fieldConfigs){
		this.fieldConfigs = fieldConfigs;
	}

	@SuppressWarnings("unchecked")
	@Override
	public <T> FieldConfig<T> getFieldConfig(String key) {
		return (FieldConfig<T>)fieldConfigs.get(key);
	}
	

}
